package com.hey.qrcode.service;

import com.hey.qrcode.common.enums.CodeStatus;
import com.hey.qrcode.common.result.SingleResult;
import com.hey.qrcode.dao.SysDao;
import com.hey.qrcode.entity.SysMember;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SysService {

    @Autowired
    SysDao sysDao;

    /**
     * 管理员登录
     * @param sysName
     * @param sysPass
     * @return
     */
    public SingleResult sysLogin(String sysName, String sysPass){
        SysMember sysMember = sysDao.login(sysName, sysPass);
        SingleResult result = new SingleResult();
        if(sysMember!=null){
            result.setData(sysMember);
            return result;
        }else {
            result.setMsg(CodeStatus.MISS_NAME);
            return result;
        }
    }
}
